package org.happen.android.bean;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import org.happen.android.bean.entity.KeyValue;
import org.happen.android.core.annotation.ReqParam;

public class BaseRequest implements IRequest
{

	@ReqParam(asParam = false)
	private static final long serialVersionUID = 1L;

	/**
	 * 请求的id，只是做标示使用，没有其他用途
	 */
	@ReqParam(asParam = false)
	public String reqId = UUID.randomUUID().toString();

	@ReqParam(asParam = false)
	public String url;

	@ReqParam(asParam = false)
	private List<KeyValue> getParams;

	public List<KeyValue> getGetParams()
	{
		return getParams;
	}

	public BaseRequest addParam(KeyValue param)
	{
		if (getParams == null)
		{
			getParams = new ArrayList<KeyValue>();
		}
		getParams.add(param);
		return this;
	}

	public String toString()
	{
		return "BaseRequest [reqId=" + reqId + ", url=" + url + ", getParams=" + getParams + "]";
	}
}